package com.geeguo.ebuilder.client.business.system.organization.service;

import com.geeguo.ebuilder.client.base.tenant.model.DataContext;
import com.geeguo.ebuilder.client.business.system.organization.model.OrgTreeNodeVO;
import com.geeguo.ebuilder.client.business.system.organization.model.OrganizationCO;
import com.geeguo.ebuilder.client.business.system.organization.model.OrganizationEntity;
import com.geeguo.ebuilder.client.business.system.organization.model.OrganizationVO;

import java.util.List;

public interface OrganizationService {

    List<OrganizationVO> list(DataContext dataContext);
    List<OrgTreeNodeVO> listValidTreeNode(DataContext dataContext);

    OrganizationEntity get(String id, DataContext dataContext);
    OrganizationEntity getByName(String parentId, String name, DataContext dataContext);
    OrganizationEntity getByNames(String names, DataContext dataContext);
    OrganizationCO getCached(String id, DataContext dataContext);

    List<String> listChildrenIds(String id, DataContext dataContext);

    String getFullPath(String id, DataContext dataContext);

    String generateCode(String parentId, DataContext dataContext);

    int getMaxSequence(String parentId, DataContext dataContext);

    boolean save(OrganizationEntity entity, DataContext dataContext);
    boolean update(OrganizationEntity current, OrganizationEntity old, DataContext dataContext);
    boolean remove(String id, DataContext dataContext);

    boolean isUsed(String id, DataContext dataContext);
    boolean existsChild(String id, DataContext dataContext);
}